#ifndef _NESSENGINESYS
#define _NESSENGINESYS
#include "SDL.h"
#include "SDL_ttf.h"
#include "SDL_opengl.h"
#include "NessTexture.h"
#include "Entity.h"
#include <math.h>

class Entity;

class NessEngineSys{
public:
	NessEngineSys();
	~NessEngineSys();
	bool InitSystem(int width, int height);
	int wWidth, wHeight;
	bool InitGL();
	void UpdateEvents();
	void UpdateSystem(int framesPerSecond);
	void Render(GLfloat x, GLfloat y, GLfloat w, GLfloat h);
	void Render(NessTexture Tex, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
	void Render(NessTexture Tex, GLfloat x, GLfloat y, GLfloat w, GLfloat h, GLfloat totalFrames, GLfloat Frame);
	void Render(Entity *entity);
	void StartMatrix(Entity *entity);
	void EndMatrix();
	void RotateEntity(Entity *entity, float angle);
	bool EntityCollision(Entity *a, Entity *b);
	SDL_Event event;
	Uint8 *key;
	bool sysDone;
	//timer for fps regulation
	int startTicks;
	int pausedTicks;
	bool paused;
	bool started;
	void StartFPS();
	void StopFPS();
	void PauseFPS();
	void UnPauseFPS();
	int GetTicks();
	bool IsStarted();
	bool IsPaused();
};

#endif //_NESSENGINESYS